CC = gcc

all: main

main: main.c decrypt.c mqtt_subscriber.c msg_queue.c report_data.c gmssl
	$(CC) -c main.c
	$(CC) -c decrypt.c -IGmSSL
	$(CC) -c mqtt_subscriber.c
	$(CC) -c msg_queue.c
	$(CC) -c report_data.c
	$(CC) main.o decrypt.o mqtt_subscriber.o msg_queue.o report_data.o GmSSL/zuc.o GmSSL/zuc_modes.o -o main -lpaho-mqtt3c

gmssl:
	cd GmSSL && make && cd -

clean:
	rm -f *~ *.a *.o *.so main
	cd GmSSL && make clean && cd -